package fx.mine.active.component.util;

import java.lang.reflect.InvocationTargetException;

public interface FactoryBuilder<T> {
    default T build() {
        try {
            T instance = (T) getClass().getGenericInterfaces()[0]
                    .getClass().getConstructors()[0].newInstance();
            return instance;
        } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException(e);
        }
    }
}
